Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

make config_dev.yml a valid YML file #687

Closed
wants to merge 1 commit into from

Conversation

jdespatis
Copy link
Contributor

%..% must be wrapped by quotes, or YML file is not valid!

`%..%` must be wrapped by quotes, or YML file is not valid!
@Tobion
Copy link
Contributor

Tobion commented Jul 29, 2014

👍

@fabpot
Copy link
Member

fabpot commented Jul 29, 2014

Thank you @jdespatis.

@fabpot fabpot closed this in 441526f Jul 29, 2014
@stof
Copy link
Member

stof commented Aug 14, 2014

Actually, wrapping in quotes is not required in YAML 1.2 (which is used by Symfony), only in YAML 1.0 or 1.1 (which is used by Pygments when doing syntax highlighting)

@jdespatis
Copy link
Contributor Author

@stof , I'm using https://github.com/nodeca/js-yaml as a YAML 1.2 Parser, and it crashes because of those %..%

=> You think it's a bug in this tool that doesn't respect 1.2 spec?

@stof
Copy link
Member

stof commented Aug 14, 2014

if it crashes on such file, it means it is not a compliant 1.2 parser. You should report a bug to the parser

@jdespatis
Copy link
Contributor Author

ok, gonna do that so
(indeed, it doesn't crash but mark the %..% as invalid)

@jdespatis
Copy link
Contributor Author

@stof according to the yaml 1.2 specs: http://www.yaml.org/spec/1.2/spec.html, the % is forbidden, it's a directive start symbol
(look at the 5.3. Indicator Characters section)

@fabpot Is there some unit test somewhere that checks the validity of each yaml file of symfony-standard ?
I think it would be interesting to have this to be sure all yaml config files are valid

My yaml reader crashes for another yaml file for example: https://github.com/symfony/symfony-standard/blob/v2.6.4/app/config/routing.yml
due to the @ symbol, which is forbidden, (reserved for futur use in yaml 1.2)

@stof
Copy link
Member

stof commented Mar 16, 2015

@jdespatis See http://www.yaml.org/spec/1.2/spec.html#id2788859 The plain style for scalars allows %, because it is not ambiguous with directives

@jdespatis
Copy link
Contributor Author

@stof I've read this section, but I'm not sure to see where it's said that this % is allowed (I can however read the starting character : ? ~ are allowed on some circumstances)

Please could you quote to me the text that indicates it's possible ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants